import storage from 'good-storage'
const LOCAL_CITY = '__citiy__'
export function debounce(func, delay) {
  let timer
  
  return function (...args) {
      console.log(1)
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      func.apply(this, args)
    }, delay)
  }
}
export const setLocalCity = function (city){
  storage.set(LOCAL_CITY,city)
  return city
}
export const loadLocalCity = function(){
  return storage.get(LOCAL_CITY,'北京')
}